package de.fanuffel.mes.model;

import java.util.ArrayList;
import java.util.List;

public class World {
  long time;

  List<Location> locations;

  public World() {
    time = 0;
    locations = new ArrayList<Location>();

    createDemoWorld();
}

  Location addLocation(int x, int y, String name) {
    Location location = new Location(x, y, name);
    locations.add(location);
    return location;
  }

  // TOOD(karlklose): replace with "The Real World" (TM).
  void createDemoWorld() {
    Location centralPlace = addLocation(0, 0, "Central Place");
    Location theFields = addLocation(-500, 10, "The Fields");
  }

  public boolean advance(long delta) {
    time += delta;
    return time > 1000 * 30;  // 30 seconds. Enough for now.
  }
}
